#!/usr/bin/env python
import sys
import helper
from sets import Set

class CommonCountReducer(helper.ReducerHelper):
    def processor(self, key, lst):
        count = 0
        key = ''
        for e in lst:
            left, right = self.split(e)
            if left is not None:
                count += int(left)
            else:
                key = e
        if count != 0 and key != '':
            self.allocator(key, count)


def main():
    cr = CommonCountReducer()
    cr.reducer()

if __name__ == '__main__':
    main()

